package com.gua.jbs.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import com.gua.jbs.bean.OrderBean;
import com.gua.jbs.service.IOrderService;
import com.gua.jbs.serviceImpl.OrderService;
import com.gua.jbs.utility.CollectionUtil;

/**
 * Controller class for Order Management
 * 
 * @author Piyush
 * 
 */
public class OrderController extends BaseController {

	private static final Logger logger = Logger
			.getLogger(OrderController.class);

	private IOrderService orderService;

	public OrderController() {
		orderService = new OrderService();
	}

	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		List<Object[]> orderList = new ArrayList<Object[]>();
		try {
			orderList = orderService.getOrders();
		} catch (Exception e) {

		}
		request.setAttribute("orders", orderList);
		rd = request.getRequestDispatcher("/pages/jsp/salesReport.jsp");
		rd.forward(request, response);
	}
}
